package io.gitee.zhucan123.core.infrastructure.exception;

import com.niimbot.middlend.core.infrastructure.annotation.ExceptionAdvice;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

/**
 * @author: zhuCan
 * @date: 2019/8/24
 * @description:
 */
@ExceptionAdvice()
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public class OverLengthException extends RuntimeException {

  public OverLengthException(String message) {
    super((String.format("data length is too long : %s", message)));
  }

  public OverLengthException(Integer length) {
    super((String.format("data  is too long for length: %s", length)));
  }

  public OverLengthException(Integer length,String message) {
    super((String.format("input source \" %s \" is too long for length: %s",message, length)));
  }
}
